package com.dx.spring6_15.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.dx.spring6_15.annotation.controller.UserController;
import com.dx.spring6_15.annotation.repository.UserRepositoryImpl;
import com.dx.spring6_15.annotation.service.UserService;

public class Main {

	public static void main(String[] args) {

		ApplicationContext ctx = new ClassPathXmlApplicationContext("com/dx/spring6_15/annotation/annotationApplicationContext.xml");
		
		TestObj testObject = (TestObj)ctx.getBean("testObj");	// 第一个字母小写
		System.out.println(testObject);
		
		UserService userServeice = (UserService)ctx.getBean("userService");	// 第一个字母小写
		System.out.println(userServeice);
		
		UserController userController = (UserController)ctx.getBean("userController");	// 第一个字母小写
		System.out.println(userController);
		
		UserRepositoryImpl userRepository = (UserRepositoryImpl)ctx.getBean("userRepository");	// 第一个字母小写
		System.out.println(userRepository);
		
	}
}
